package model.strategies;

import model.GameConstants;
import model.Player;
import model.Player.PlayerState;
/**
 * Strategy used to control players who are TCTF.
 * @author N. Bhatia, A. Butt, N. Evans, C. Levesque, P. OKeefe
 *
 */
public class TCTFStrategy extends MoveablePlayerStrategy {
	
	private final Player player;
	private int elapsedTimeInTCTF;
	public TCTFStrategy(Player player) {
		super(player);
		this.player = player;
		elapsedTimeInTCTF = 0;
	}
	
	@Override
	public void update(int elapsedTimeInMillis){		
		super.update(elapsedTimeInMillis);
		elapsedTimeInTCTF += elapsedTimeInMillis;
		if (elapsedTimeInTCTF > GameConstants.MAX_TIME_IN_TCTF_MILLIS){
			player.setState(PlayerState.PRISONER);
		}
		
	}

}
